import { createRouter, createWebHistory } from 'vue-router'
import UserCenter from '../user_center/UserCenter.vue'
import Index from '../index/Index.vue'
import MyCourse from '../course/MyCourse.vue'
import NewCourse from '../course/NewCourse.vue'
import SearchCourse from '@/course/SearchCourse.vue'
import SearchResource from '@/resource/SearchResource.vue'
import ResourceShow from '@/resource/ResourceShow.vue'
import SharedResource from '@/resource/SharedResource.vue'
import MyResource from '@/resource/MyResource.vue'
import Manager from '@/system_manager/Manager.vue'
import Auditor from '@/auditor/Auditor.vue'
import EarnPoints from '@/components/EarnPoints.vue'
import CreditShop from '@/components/CreditShop.vue'
import ArticleEditor from '@/components/Article/ArticleEditor.vue'
//import Forum from '@/components/Forum/Forum.vue'
//import Forum from '@/components/Forum/Forum.vue'
import CreditCertification from '@/user_center/CreditCertification.vue'
import CourseDetail from "@/course/CourseDetail.vue";
import PoetryRecitation from '@/components/PoetryRecitation.vue'
import MultipleChoiceQuiz from "@/components/MultipleChoiceQuiz.vue";
import CourseCreditCertification from '../user_center/CourseCreditCertification.vue';
import LoginCallback from "@/components/LoginCallback.vue";
import ResetPassword from "@/views/ResetPassword.vue";
import Forum from '@/components/Forum/Forum .vue'


const routes = [
    {
      path: '/',
      component: Index
    },
    {
      path: '/user-center',
      component:UserCenter
    },
    {
      path:'/my-course',
      component:MyCourse
    },
    {
        path: '/course/:id',
        name: 'CourseDetail',
        component: CourseDetail
    },
    {
      path:'/new-course',
      component:NewCourse
    },
    {
      path:'/search-course',
      component:SearchCourse
    },
    {
      path:'/search-resource',
      component:SearchResource
    },
    {
        path: '/resource/:id',
        name: 'ResourceShow',
        component: ResourceShow
    },
    {
      path:'/share-resource',
      component:SharedResource
    },
    {
      path:'/my-resource',
      component:MyResource
    },
    {
      path:'/manager',
      component:Manager
    },
    {
      path:'/auditor',
      component:Auditor
    },
    {
      path:'/earn-points',
      component:EarnPoints
    },
    {
    path: '/poetry-recitation', // 古诗词练习路由
    name: 'PoetryRecitation',
    component: PoetryRecitation
    },
    {
        path: '/quiz', // 定义访问路径
        name: 'MultipleChoiceQuiz', // 定义路由名称
        component: MultipleChoiceQuiz // 指定对应的组件
    },
    {
      path:'/mall',
      component:CreditShop
    },
    {
        path: '/write/article',
        name: 'ArticleEditor',
        component: ArticleEditor
    },
    {
      path: '/forum',
      component: Forum
    },
    {
        path: '/user-center/credit-certification', // 添加学分认证路由
        name: 'CreditCertification',
        component: CreditCertification
    },
    {
        path: '/user-center/course-credit-certification',
        name: 'CourseCreditCertification',
        component: CourseCreditCertification,
        meta: { requiresAuth: true }
    },
    {
        path: '/login/callback',
        name: 'LoginCallback',
        component: LoginCallback
    },
    {
        path: '/reset-password',
        name: 'ResetPassword',
        component: ResetPassword
    }

]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router